﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MMS.Model;

namespace MyMMS
{
    public partial class FormSPXuanze : Form
    {
        public List<GoodsInfo> ShowData;
        public GoodsInfo SelectGoods { get; set; }
        public FormSPXuanze()
        {
            InitializeComponent();
        }

        private void FormSPXuanze_Load(object sender, EventArgs e)
        {
            dgvSPXuanze.AutoGenerateColumns = false;
            dgvSPXuanze.DataSource = new BindingList<GoodsInfo>(ShowData);
        }

        private void dgvSPXuanze_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (dgvSPXuanze.SelectedRows.Count>0)
                {
                    int Row = dgvSPXuanze.SelectedRows[0].Index;
                    this.SelectGoods = ShowData[Row - 1];
                    this.Close();
                }
            }
        }
    }
}
